package com.jrx.anytxn.reporting.job.unionFile.step;

import com.jrx.anytxn.param.entity.PrOrganizationTable;
import com.jrx.anytxn.reporting.constant.ReportingConstant;
import com.jrx.anytxn.transaction.entity.TlThirdPartyPayment;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.batch.MyBatisPagingItemReader;

import java.util.HashMap;
import java.util.Map;

public class UnionThirdRepayFileReader extends MyBatisPagingItemReader<TlThirdPartyPayment> {

    public UnionThirdRepayFileReader(SqlSessionFactory sqlSessionFactory, Integer pageSize, PrOrganizationTable org){
        setSaveState(false);
        setPageSize(pageSize);
        setSqlSessionFactory(sqlSessionFactory);
        setQueryId("com.jrx.anytxn.transaction.mapper.ext.ExtTlThirdPartyPaymentMapper.selectByBusinessDate");
        Map<String,Object> map = new HashMap<>();
        map.put("businessDate",org.getToday());
        map.put("sumStatus", ReportingConstant.PAYMENT_LOG_SUM_STATUS_S);
        setParameterValues(map);
    }
}
